# Compiler and flags
CXX = g++
CXXFLAGS = -O3 -std=c++17 -Wall -Wextra -march=native $(shell pkg-config --cflags opencv4) -g -fopenmp -pthread -lsqlite3
LDFLAGS = -llzma $(shell pkg-config --libs opencv4) -pthread -fopenmp -lsqlite3

# Source files and target
SRCS = $(wildcard *.cpp)
OBJS = $(SRCS:.cpp=.o)
HEADERS = $(wildcard *.h *.hpp)
TARGET = satlab

# Default target
all: $(TARGET)

# Linking
$(TARGET): $(OBJS)
	$(CXX) $(OBJS) -o $(TARGET) $(LDFLAGS) -g

# Compilation
%.o: %.cpp $(HEADERS)
	$(CXX) $(CXXFLAGS) -c $< -o $@ -g

.INTERMEDIATE: $(OBJS)

.PHONY: clean
clean:
	rm -f $(OBJS) $(TARGET)

.PHONY: all clean 